using Rhino.Etl.Core.ConventionOperations;

namespace EtlDemo.Rhino.JobCounts.Inputs
{
    public class JobCountsByZipCodeInput : ConventionInputCommandOperation
    {
        public JobCountsByZipCodeInput() : base("source")
        {
            Command =
                @"select
                    j.ZipCode as [Zip]
                  , count(1) as [JobCount]
                from
                    Jobs j
                inner join Contract c
                    on j.ContractId = c.Id
                where
                    c.[Status] = 'active'
                group by
                    j.ZipCode";
        }
    }
}